package com.gxuwz.Market.business.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.Market.business.dao.ServiceTaskDAO;
import com.gxuwz.Market.business.entity.ServiceTask;
import com.gxuwz.core.pagination.Result;

@Service("serviceTaskService")
public class ServiceTaskImpl implements IServiceTaskService {

	@Autowired
	private ServiceTaskDAO serviceTaskDAO;
	
	@Override
	public ServiceTask findById(int id) {
		return serviceTaskDAO.findById(id);
	}

	@Override
	public List<ServiceTask> findAll() {
		// TODO Auto-generated method stub
		return serviceTaskDAO.findAll();
	}

	@Override
	public Result<ServiceTask> find(ServiceTask serviceTask, int page, int size) {
		// TODO Auto-generated method stub
		return serviceTaskDAO.find(serviceTask, page, size);
	}

	@Override
	public List<ServiceTask> findByProperty(String property, String value) {
		// TODO Auto-generated method stub
		return serviceTaskDAO.findByProperty(property, value);
	}

	@Override
	public void add(ServiceTask serviceTask) {
		// TODO Auto-generated method stub
		serviceTaskDAO.save(serviceTask);
	}

	@Override
	public void delete(int id) {
		// TODO Auto-generated method stub
		ServiceTask serviceTask = serviceTaskDAO.findById(id);
		serviceTaskDAO.remove(serviceTask);
	}

	@Override
	public void update(ServiceTask serviceTask) {
		// TODO Auto-generated method stub
		serviceTaskDAO.update(serviceTask);
	}

	@Override
	public List<ServiceTask> findByState(int taskState) {
		return serviceTaskDAO.findByState(taskState);
	}

	@Override
	public void checkTime() {
		// TODO Auto-generated method stub
		serviceTaskDAO.checkTime();
	}

}
